<template>
  <div>
    <el-container>
      <el-main>
        <el-tabs :tab-position="tabPosition" v-model="tabSelected">
          <el-tab-pane label="会员中心" disabled></el-tab-pane>
          <el-tab-pane label="个人资料"><router-view /></el-tab-pane>
          <el-tab-pane label="修改密码"><router-view /></el-tab-pane>
          <el-tab-pane label="个人订单"><router-view /></el-tab-pane>
          <el-tab-pane label="收货地址"><router-view /></el-tab-pane>
          <el-tab-pane label="充值余额"><router-view /></el-tab-pane>
          <el-tab-pane label="余额日志"><router-view /></el-tab-pane>
          <el-tab-pane label="浏览/收藏"><router-view /></el-tab-pane>
          <el-tab-pane label="退出"><router-view /></el-tab-pane>
          <el-tab-pane label="商家中心" disabled></el-tab-pane>
          <el-tab-pane label="基础信息"><router-view /></el-tab-pane>
          <el-tab-pane label="发布信息"><router-view /></el-tab-pane>
          <el-tab-pane label="商家订单"><router-view /></el-tab-pane>
          <el-tab-pane label="商家认证"><router-view /></el-tab-pane>
          <el-tab-pane label="保证金"><router-view /></el-tab-pane>
        </el-tabs>
      </el-main>
      
    </el-container>
  </div>
</template>

<script>
export default {
  data() {
    return {
      tabPosition: "left",
      // activeName: "first",
      tabSelected: this.$route.path.split('/').pop()
    };
  },
  mounted(){
    // console.log(this.$route)
    // console.log(this.$route.path)
    // console.log(this.$route.path.split('/'))
    // console.log(this.$route.path.split('/').pop())
  },
  watch: {
    tabSelected(to, from){  // tabSelected变化时自动执行
      console.log('点击了：' + to);
      if(to=='1'){
        this.$router.push('/indexuser/userdata')
      }else if(to=='2'){
        this.$router.push('/indexuser/password')
      }else if(to=='3'){
        this.$router.push('/indexuser/orderform')
      }else if(to=='4'){
        this.$router.push('/indexuser/add')
      }else if(to=='5'){
        this.$router.push('/indexuser/topup')
      }else if(to=='6'){
        this.$router.push('/indexuser/balance')
      }else if(to=='7'){
        this.$router.push('/indexuser/browse')
      }else if(to=='8'){
        this.$router.push('/indexuser/quit')
      }else if(to=='10'){
        this.$router.push('/indexuser/merchant')
      }else if(to=='11'){
        this.$router.push('/indexuser/issue')
      }else if(to=='12'){
        this.$router.push('/indexuser/merchantsOrders')
      }else if(to=='13'){
        this.$router.push('/indexuser/authentication')
      }else if(to=='14'){
        this.$router.push('/indexuser/earnestMoney')
      }
    }
  }
};
</script>

<style lang="scss" >
.el-container {
  width: 1000px;
  margin: 0 auto;

.is-disabled{
    color: #000;
    font-size: 20px;
}
}
</style>